package com.itheima.d1_create_thread;

public class MyThread extends Thread{
    public MyThread(String name){
        super(name);
    }
    @Override
    public void run() {
        //哪个线程执行它，他就会得到哪个线程对象
        Thread thread = Thread.currentThread();
        for (int i1 = 0; i1 < 3; i1++) {
            //获取线程名字
            System.out.println(thread.getName()+"输出"+i1);
        }

    }
}
